<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
  <![endif]-->
  <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
  <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
  <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
  <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
  <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<![endif]-->
<title>提现</title>
</head>
<body>
<div class="pd-20">
  {{--<form class="Huiform" action="/" method="post">--}}
    <table class="table">
      <tbody>
        <tr>
          <input type="hidden" name="_token" value="{{csrf_token()}}"/>
          <th width="100" class="text-r"><span class="c-red">*</span>提现账号:</th>
          <input type="hidden" name="user_id" value="{{$user_id}}">
          <td><input type="text" style="width:200px" class="input-text" value="" id="teacher-new-password" name="account"></td>
        </tr>
        <tr>
          <th class="text-r"><span class="c-red">*</span> 提现金额:</th>
          <td><input type="text" style="width:200px" class="input-text" value="" id="teacher-new-password2" name="money"></td>
        </tr>
        <tr>
          <th></th>
          <td><button class="btn btn-success radius" id="btn" type="submit"><i class="icon-ok"></i>确定</button></td>
        </tr>
      </tbody>
    </table>
  {{--</form>--}}
</div>


<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script>

<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script>
    $("#btn").on("click",function () {
          var user_id = $('input[name="user_id"]').val();
          var account = $('input[name="account"]').val();
          var money = $('input[name="money"]').val();
          var _token = $('input[name="_token"]').val();
        var reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
        if(account == ""){
            layer.msg("请填写提现账号",{icon:5,time:3000});
            return;
        }
        if (money=="") {
            layer.msg("请填写提现金额",{icon:5,time:3000});
            return;
        }
       if(!reg.test(money)){
           layer.msg("提现金额有误",{icon:5,time:3000});
           return;
       }
       $.ajax({
           type:'post',
           url:'/agentadmin/operacash',
           data:{
               'user_id':user_id,
               'account':account,
               'money':money,
               '_token': "{{csrf_token()}}",
           },
           dateType:'json',
           success: function(result){
               if(result.status == 'true'){
                   layer.msg(result.msg,{icon:6});
                   setTimeout(function(){
                       window.location.reload();
                   },3000)
               }else{
                   layer.msg(result.msg,{icon:5,time:2000});
                   return false;
               }
           },
       });
    })
</script>
</body>
</html>